package org.NooLab.itexx.app.gui;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JLabel;




public class StatusLabel extends JLabel {

	
	
	private String borderString="";

	public StatusLabel (){
		super();
	}
	public StatusLabel (String text){
		super(text);
	}

	public void setLabelBorder( int direction, int amount){
		
		int n = (int) (amount *0.32);
		for (int i=0;i<n;i++){
			borderString = borderString+" ";
		}
	}
	
	@Override
    protected void paintComponent(Graphics g) {
		
		Graphics2D g2d = (Graphics2D) g;
		
		
		
		g2d.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING ,
  			  				  RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);

		g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING ,
  				  			  RenderingHints.VALUE_ANTIALIAS_OFF);

		if (getText().startsWith(borderString)==false){
			setText( borderString + getText());
		}
		super.paintComponent(g);
	}
    
	
}


